package com.yulan.fastkillcourse.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yulan.fastkillcourse.Dto.CourseDto;
import com.yulan.fastkillcourse.model.Course;
import org.apache.ibatis.annotations.Select;

import java.util.List;


public interface CourseMapper extends BaseMapper<Course> {

    @Select("select t1.cid,t1.name,t1.start_Time,t1.end_Time,t2.margin,t1.teacher_Name,t1.kind,t2.hot, t2.score,\n" +
            "t1.time_Interval from t_course t1, course_margin t2 where t1.cid = t2.cid ")
    List<CourseDto> getAll();

    @Select("select t1.cid,t1.name,t1.start_Time,t1.end_Time,t2.margin,t1.teacher_Name,t1.kind,t2.hot, t2.score,\n" +
            "t1.time_Interval from t_course t1, course_margin t2 where t1.cid = #{cid} and t2.cid = #{cid} ")
    CourseDto getOne(int cid);

}
